package org.quickstart.api.action;

import com.google.gwt.user.client.rpc.IsSerializable;
import net.customware.gwt.dispatch.shared.AbstractUpdateResult;
import net.customware.gwt.dispatch.shared.Action;
import org.quickstart.model.Contact;

import java.io.Serializable;

/**
 * EXAMPLE
 *
 * @author Yoav Aharoni
 */
public class UpdateContactAction implements Action<UpdateContactAction.Result> {
	private String name;
	private Contact contact;

	public UpdateContactAction() {
	}

	public UpdateContactAction(String name, Contact contact) {
		this.name = name;
		this.contact = contact;
	}

	public Contact getContact() {
		return contact;
	}

	public String getName() {
		return name;
	}

	public static class Result extends AbstractUpdateResult<Contact> implements Serializable {
		public Result() {
		}

		public Result(Contact oldValue, Contact newValue) {
			super(oldValue, newValue);
		}
	}
}
